package com.atguigu.day17.homework.h3;

import java.util.ArrayList;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/21 16:52
 * @注释
 */
public class StringTest {
    public static void main(String[] args) {
        ArrayList list = new ArrayList();

        list.add(new Student("张三",100));
        list.add(new Student("李四",99.5));
        list.add(new Student("王五",10));
        list.add(new Student("赵六",100));

        double max = -1;
        for (Object obj : list) {
            Student student = (Student) obj;
            if (student.getScore() > max) {
                max = student.getScore();
            }
        }
        System.out.println(max);

        System.out.print("最高分学生有:");
        for (Object obj : list) {
            Student student = (Student) obj;
            if (student.getScore() == max) {
                System.out.print(student.getName() + "  ");
            }
        }
        System.out.println();


    }
}
